#ifndef UTIL_H_INCLUDED
#define UTIL_H_INCLUDED

int ClampI(int lower, int upper, int n)
{
    n = n>upper ? upper : n;
    return n<lower ? lower : n;
}

#endif // UTIL_H_INCLUDED
